<!--
 * @Author: 叫我龟先生 yyxxkahhh@163.com
 * @Date: 2022-09-22 18:16:01
 * @LastEditors: 叫我龟先生 yyxxkahhh@163.com
 * @LastEditTime: 2022-09-22 18:19:46
 * @FilePath: \todolist\src\本地储存.html
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        //vue监听数组变化的原理
        const arr = ['好好','丽丽','友友']
        const pro = {}
        pro.__proto__ =Array.prototype

        arr.__proto__ = pro

        pro.push = function(...args){
            console.log('调用了push方法');
            Array.prototype.push.call(this,...args)
        }
    </script>
</body>
</html>